
package com.sgcc.system.api.factory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.sgcc.common.core.web.domain.AjaxResult;
import com.sgcc.system.api.RemoteOAnomalyInfoService;
import com.sgcc.system.api.domain.OAnomalyInfo;

import feign.hystrix.FallbackFactory;

/**
 * 文件服务降级处理
 *
 * @author sgcc
 */
@Component
public class RemoteOAnomalyInfoFallbackFactory implements FallbackFactory<RemoteOAnomalyInfoService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteOAnomalyInfoFallbackFactory.class);

    @Override
    public RemoteOAnomalyInfoService create(Throwable throwable)
    {
        log.error("失败:{}", throwable.getMessage());
        return new RemoteOAnomalyInfoService()
        {
            @Override
            public AjaxResult addAdmin(OAnomalyInfo oAnomalyInfo) {
                return AjaxResult.error("插入数据超时请稍后在试~");
            }

			@Override
			public AjaxResult addAdminProcess(OAnomalyInfo anomalyInfo) {
				// TODO Auto-generated method stub
				 return AjaxResult.error("插入数据超时请稍后在试~");
			}

            @Override
            public AjaxResult updateOAnomalyStatTask() {
                return AjaxResult.error("插入数据超时请稍后在试~");
            }
        };
    }
}
